<?php

namespace app\admin\controller;

use think\Request;
use app\admin\service\OrderService;

class Order extends Base{
		/**
		 * 订单列表
		*/
		public function index(){
				$orderService = new OrderService;
				$param = Request::instance()->param();
				$data = $orderService->index($param);
				// dump($data);die;
				$this->assign('data',$data);
				return $this->fetch();
		}

		/**
		 * 结算列表
		*/
		public function orderBalance()
		{
				$orderService = new OrderService;
				$param = Request::instance()->param();
				$data = $orderService->orderBalance($param);
				$this->assign('data',$data);
				return $this->fetch();
		}

		/**
		 * 选择查看的商品
		*/
		public function myGoods()
		{
				$param = Request::instance()->param();
				$orderService = new OrderService;
				$data = $orderService->myGoods($param);
				// dump($data);die;
				$this->assign('data',$data);
				return $this->fetch();
		}

		/**
		 * 查看用户订单
		*/
		public function lookOrder()
		{
				$orderService = new OrderService;
				$param = Request::instance()->param();
				$data = $orderService->lookOrder($param);
				// dump($data);die;
				$this->assign('data',$data);
				return $this->fetch();
		}

		/**
		 * 结算订单
		*/
		public function balanceOrder()
		{
				$orderService = new OrderService;
				$post = Request::instance()->post();
				return json($orderService->balanceOrder($post));
		}
}
